<template>
<div class="bh-collapse-item" @click='change' :class="{'is-active': actived}">
	<div class="bh-collapse-item__header">
		<span>{{title}}</span>
		<bh-icon name="arrow-right" class="bh-collapse-item__arrow"></bh-icon>
	</div>
	<div class="bh-collapse-item__wrap">
		<div class="bh-collapse-item__content">
			<slot></slot>
		</div>
	</div>
</div>
</template>

<script>
export default {
	name: 'bh-collapse-item',
	props: {
		name: {
			type: String,
			default: '',
		},
		title: {
			type: String,
			default: '',
		},
	},
	data() {
		return {
			actived: true,
		}
	},
	methods: {
		change() {
			console.log(11);
			this.actived = !this.actived;
			this.$emit('change');
		},
	},
	computed: {
		typeClass() {
			return `bh-alert-${ this.type }`;
		},
	},
}
</script>
